import prisma from "@/app/utils/prismadb";
import serverAuth from "@/app/utils/serverAuth";
import { NextResponse } from "next/server";

export const GET = async ()=>{
    try {
        await serverAuth();
         const movies = await prisma.movie.findMany({
            take:10,
            skip:0
         })
        return  NextResponse.json({ data: movies }, { status: 200 })
    } catch (error) {
        console.log('current',error)
        return NextResponse.json({ message:"Internal server error" }, { status: 400 })
    }

}





